package com.gopay.common.manager.ptbank.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gopay.common.constants.ptbank.HfBankConstants.BankServiceState;
import com.gopay.common.dao.ptbank.GsrtBankSuperviseNameDao;
import com.gopay.common.domain.ptbank.GsrtBankSuperviseName;
import com.gopay.common.manager.ptbank.GsrtBankSuperviseNameManager;

/**
 * G商融通托管银行表
 * GsrtBankSuperviseNameManagerImpl.java
 * 2016年4月27日
 * @author donghuijun
 *  www.gopay.com.cn Inc.All rights reserved.
 */
@Service("gsrtBankSuperviseNameManager")
public class GsrtBankSuperviseNameManagerImpl implements GsrtBankSuperviseNameManager {
	@Resource(name = "gsrtBankSuperviseNameDao")
	private GsrtBankSuperviseNameDao gsrtBankSuperviseNameDao;

	@Override
	public List<GsrtBankSuperviseName> getGsrtBankSuperviseNameList() {
		return gsrtBankSuperviseNameDao.getBankBankSuperviseNameList();
	}

	@Override
	public GsrtBankSuperviseName findBankInfoByBbankSuperviseId(Long bankSuperviseId) {
		Map<String, Object> param = null;
		StringBuffer hql=new StringBuffer("from GsrtBankSuperviseName t where t.bankSuperviseId="+bankSuperviseId);
		//服务状态是开启的
		hql.append(" and t.bankState='").append(BankServiceState.OPENED.value).append("'");
		return gsrtBankSuperviseNameDao.findByHql(hql.toString(), param).get(0);
	}

}
